package gui;

import java.awt.FlowLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

public class MainWindow extends JFrame {

   private static final long serialVersionUID = 2740437090361841747L;
   private JLabel processedTitleLabel;
   private JLabel foundTitleLabel;
   private String processed = "Processed: 0";
   private String found = "Found: 0";
   private FlowLayout flow;
   
   public MainWindow() {
      super("JWC");
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      
      flow = new FlowLayout();
      processedTitleLabel = new JLabel(processed);
      foundTitleLabel = new JLabel(found);

      setLayout(flow);
      add(processedTitleLabel);
      add(foundTitleLabel);
      
      pack();
      setVisible(true);

      SwingUtilities.updateComponentTreeUI(this);
   }
   
   public void refresh(int processed, int found) {
      processedTitleLabel.setText("Processed: " + processed);
      foundTitleLabel.setText("Found: " + found);
      pack();
   }

}
